{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 168,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Populating the interactive namespace from numpy and matplotlib\n"
     ]
    }
   ],
   "source": [
    "%pylab inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 169,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from scipy import stats"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 170,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "rv = stats.norm(0,1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 171,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWUAAAETCAYAAADu/hdnAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8VOXZ//HPNclkIwvIJsgWURJABKloXUEFRQIqClWw\nKFYfa221fWpXl2qf2qet8tTui20Vd60r8AMBi+BSBWUTRaCIsoVNEEgCAULm+v0xZ8IhTCDLzJwz\nM9f79eKVc+45Z+YKM/PNPfeccx9RVYwxxvhDwOsCjDHGHGKhbIwxPmKhbIwxPmKhbIwxPmKhbIwx\nPmKhbIwxPmKhbIwxPmKhbIwxPmKhbIwxPmKhbIwxPmKhbIwxPmKhbIwxPmKhbIwxPmKhbIwxPmKh\nbIwxPmKhbIwxPmKhbIwxPmKhbIwxPmKhbIwxPmKhbIwxPmKhbIwxPmKhbIwxPmKhbIwxPmKhbIwx\nPmKhbIwxPmKhbIwxPmKhbIwxPmKhbIwxPmKhbFKGiIwQkZkiMs/5OcLrmoxpKlFVr2swpkVEJBO4\nCbgXON5103rgW6o6zZPCTNyIyDhVfcbrOuLBQtn4ioj45gWpquJ1DelIRPKAa4Bs4CVV3Vrv9l8A\n61T1Ly18nG8Ce1R1ckvuJ9YyvS7AmPruu+++Bm/79NN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CwyjgcxsydEXLwAlhAer1wK3qOrmZt2ZD4nIasID8pHJ9t9V1Vs9LCmm\nRGQ08DugHbAbWKKql3pbVcuIyKXAbwhPp/gPVf2FxyXFlIg8AwwG2gLbgJ+o6qPeVhUbInIu8Cbh\nyeIjofRjVZ3pXVWxIyL9gMcIvzYDhOdZvj/qtnaatTHG+Ied0WeMMT5ioWyMMT5ioWyMMT5ioWyM\nMT5ioWyMMT5ioWyMMT5ioWyMMT5ioWyMMT5ioWyMMT5ioWyMMT5ioWyMMT5ioWyMMT5y1PmUjUkW\nIvIl4FrCM4z1AG4Cvg60JnwFkntV9VPPCjSmkSyUTdJz5va+XlVvd9YnA/OB6wl/GnwLWAw85FWN\nxjSWhbJJBd8BvudabwV8oarzRaQL8H/AZC8KM6apbD5lk/REpJuqrnetlwOPqOo9HpZlTLPYF30m\n6dUL5N5AJ2CudxUZ03wWyibVXAQcAN6JNIhIsXflGNM0FsomqYlIrog8ICKnOE3DgA8iF7sVkQCH\njzcb42v2RZ9JdiOAO4BFInIQKAZ2uW6/E3jci8KMaQ77os8kNRFpCzwA7CB8jPJPgT8B+wgPY0xR\n1TneVWhM01goG2OMj9iYsjHG+IiFsjHG+IiFsjHG+IiFsjHG+IiFsjHG+IiFsjHG+IiFsjHG+IiF\nsjHG+IiFsjHG+IiFsjHG+Mj/B27bic1oSdyOAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xdac2230>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig,ax=subplots()\n",
    "xi = np.arange(-3,3,.1)\n",
    "ax.plot(xi,rv.pdf(xi),'k',lw=3.,label='$f(x)$')\n",
    "xi = linspace(-3,3,20)\n",
    "xi = np.arange(-3,3,.3)\n",
    "xb = xi.reshape(-1,2)\n",
    "xl = xb[:,0] # left edge points\n",
    "ax.plot(xl,rv.pdf(xl),'ko')\n",
    "width = np.diff(xl)[0]\n",
    "ax.bar(xl-width/2,rv.pdf(xl),width=width,alpha=.3,color='gray')\n",
    "ax.bar(-width/2,0.4,width=width,hatch='/',color='gray')\n",
    "ax.set_xlabel(r'$x$',fontsize=20)\n",
    "ax.set_ylabel(r'$f(x)$',fontsize=20)\n",
    "ax.axis(xmin=-3,xmax=3)\n",
    "ax.spines['right'].set_visible(False)\n",
    "ax.spines['top'].set_visible(False)\n",
    "ax.spines['top'].axis.set_ticks_position('none')\n",
    "# ax.spines['right'].axis.set_ticks_position('none')\n",
    "ax.legend(fontsize=24,frameon=False)\n",
    "ax.yaxis.set_visible(False)\n",
    "ax.spines['left'].set_visible(False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 172,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# fig.savefig('../fig-probability/Sampling_Monte_Carlo_000.png')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 186,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAdcAAAILCAYAAAC6kNYIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFOlJREFUeJzt3X2wbXdd3/HPF6gYQkCgQiSiiEQeRKgo5ZmEImEsgYkg\nHcehWB502qJCiZTKWEQtA9aSWqrVFihgrPYBSlqbCcIgENCRpwYQBKlIIKTQROQhJERM8u0fe1+8\nHO5NdsI3Z6177+s1k1l3r73P3O/8cs5+37322utUdwcAmHOTpQcAgKONuALAMHEFgGHiCgDDxBUA\nhokrAAwTVwAYJq4AMExcAWCYuALAMHEFgGHiCgDDxBUAhokrAAwTVwAYJq4AMExcAWCYuALAMHEF\ngGHiCgDDxBUAhokrAAwTVwAYJq4AMExcAWCYuALAMHEFgGHiCgDDxBUAhokrAAwTVwAYJq4AMExc\nAWCYuALAMHEFgGHiCgDDxBUAhokrAAwTVwAYJq4AMExcAWCYuALAMHEFgGHiCgDDxBUAhokrAAwT\nVwAYJq4AMExcAWCYuALAMHEFgGH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Ciu1PTx8epLz9oT1tknumeR8YYV1EldYr4clOT7J\n6/fsd0gYVk5cYb3utt1esGf/V8S1qv5LVflZhhXxAwnrddPt9vMHdlTVcUnOSPKF7n5vVd0iyc26\ne+/ZxMCCxBXW641Jrk7yiCSpqhOSvDTJJ5J8cfuYpyR59SLTAYflbGFYsap6fJKfSXJZki8keV6S\njyX57SS3SvLO7n76chMChyKuADDMYWEAGCauADBMXAFgmLgCwDBxBYBh4goAw8QVAIaJKwAME1cA\nGCauADBMXAFg2P8HD8ltOuu638sAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1037c250>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax= subplots()\n",
    "fig.set_size_inches((8,8))\n",
    "ax.axis((0,1,0,1))\n",
    "ax.yaxis.set_visible(False)\n",
    "ax.set_xlabel('$u$',fontsize=24)\n",
    "ax.set_xticks(arange(0,1+1/12,1/6))\n",
    "ax.spines['right'].set_color('none')\n",
    "ax.spines['top'].set_color('none')\n",
    "ax.spines['left'].set_color('none')\n",
    "ax.xaxis.set_ticks_position('bottom')\n",
    "ax.yaxis.set_ticks_position('none')\n",
    "\n",
    "for i in range(6):\n",
    "    ax.text(1/6/2.+i/6,0.1/2,'%d'%(i+1),fontsize=20)\n",
    "        \n",
    "ax.set_xticklabels(['$0$']+[r'$\\frac{%d}{6}$'%(i) for i in range(1,6)]+['$1$'],fontsize=20);\n",
    "fig.savefig('../fig-probability/Sampling_Monte_Carlo_0001.png',bbox_inches=Bbox([[0,0],[8,3]]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 174,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWgAAAEsCAYAAADuLCmvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEHZJREFUeJzt3XmU/fd8x/HnK5aILCS2EIoQu6itiCV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AuwPXrLjZw8btKZs5mzQrBlrz6uHACeO/HwXsDLxvxW0e\nOm4/uFlDSbPk3yTU3EvyLmB/4BZVdcWy/WcAuwG7lN/omkM+gtZcGw917A+ctCLOuwB3A04zzppX\nBlrz7mHA9sD7V+z38IbmnoHWvLvzuP30iv3/L9BJ/jmJ3++aK37Dat5dZ9z+cGlHku2AA4HLquqz\nSW4IXLeqVp7lIbVmoDXvTgauBh4BkGRH4M3AN4Afjbd5OnD8JNNJ6+BZHJp7SQ4CXgxcClwGvAQ4\nF3gXsBPwiao6dLoJpa1joCWpKQ9xSFJTBlqSmjLQktSUgZakpgy0JDVloCWpKQMtSU0ZaElqykBL\nUlMGWpKaMtCS1NT/AoKrgWElDnTyAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x10a8c1f0>"
      ]
     },
     "execution_count": 174,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fig"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
